<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="/pages/common/component.jsp"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>


<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>新增债权信息</title>
    
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	<!--
	<link rel="stylesheet" type="text/css" href="styles.css">
	-->

<script type="text/javascript">
var oprateAction = "creditDebtAction.do";

$(document).ready(function() {
	// 借款时间
	configDate('loanDate', '<fmt:formatDate value="<%=new Date() %>" pattern="yyyy-MM-dd" type="date"/>', 'yy-mm-dd');
	// 还款时间
	configDate('deadlineDate', '<fmt:formatDate value="<%=new Date() %>" pattern="yyyy-MM-dd" type="date"/>', 'yy-mm-dd');
	// 校验主表单
    $("#creditDebtform").validationEngine();
});
  	
// 返回账户列表
function back2list(){
	if(confirm("数据没有保存!确认将丢失当前表单数据!")){
		window.location.href = oprateAction+"?method=list"
	}else{
		return ;
	}
}

</script>	
	
</head>
  
  <body>
   <html:form styleId="creditDebtform" method="post" action="creditDebtAction.do">
    <input type="hidden" name="method" value="insert"/>
    <br/><br/><br/><br/>
    <table width="40%" border="0" cellpadding="2" cellspacing="1" bgcolor="#D1DDAA" align="center" style="margin-top:8px">
		<tr align="center" bgcolor="#FAFAF1" height="22">
			<td colspan="2"><b>新增债务</b></td>
		</tr>
		<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
			<td width="10%">债务人</td>
			<td width="30%">
				<input type="hidden" name="creatorId" value="${objLoginUser.userId }"/>
				<input type="hidden" name="debtor" value="${objLoginUser.name }"/>
				${objLoginUser.name }
			</td>
		</tr>
		<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
			<td width="10%">债权人</td>
			<td width="30%">
				<input class="validate[required]" id="creditor" name="creditor" style='width:30%;'/>
			</td>
		</tr>
		<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
			<td>金额</td>
			<td>
				<input class="validate[required,custom[number]]" id="amount" name="amount" value="0" style='width:30%;'/>
			</td>
		</tr>
		<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
			<td>利息</td>
			<td>
				<input class="validate[required,custom[number]]" id="interest" name="interest" value="0" style='width:30%;'/>
			</td>
		</tr>
		<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
			<td>借款时间</td>
			<td>
				<input class="validate[required]" id="loanDate" name="loanDate" style='width:30%;' readonly/>
			</td>
		</tr>
		<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
			<td>承诺还款时间</td>
			<td>
				<input id="deadlineDate" name="deadlineDate" style='width:30%;' readonly/>
			</td>
		</tr>
		<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
			<td>汇入账户</td>
			<td>
				<select name="inAccountId" style='width:30%;' >
					<c:forEach var="account" items="${lstAccountVOs}">
						<option value="${account.accountId }">${account.accountName}:${account.amount}</option>
					</c:forEach>	
				</select>
			</td>
		</tr>
		<tr align='center' bgcolor="#FFFFFF" onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';" height="22">
			<td>备注</td>
			<td>
				<input name="note" style='width:30%;'/>
			</td>
		</tr>
		<tr>
			<td colspan="2" align="center">
				<html:submit value="提交"></html:submit>
				&nbsp;&nbsp;&nbsp;
				<input type="button" value="返回" onclick="back2list();"> 
			</td>
		</tr>
    </table>
   </html:form> 
    
  </body>
</html>
